﻿using System.Web.Http;
using YawetagLib.Facade;

namespace YawetagLib.Web.Controllers
{
    public abstract class BaseApiController : ApiController
    {
        protected BaseApiController(IFacadeFactory facadeFactory)
        {
            FacadeFactory = facadeFactory;
        }

        protected TFacade At<TFacade>() where TFacade : IFacade
        {
            return FacadeFactory.Get<TFacade>();
        }

        protected IFacadeFactory FacadeFactory { get; private set; }
    }
}
